<#macro paginate currentPage totalPage actionUrl urlParas="" totalNum=0>

	<#if (totalPage <= 1) || (currentPage > totalPage)><#return></#if>
	<#local startPage = currentPage - 4>
	<#if (startPage < 1)><#local startPage = 1></#if>
	
	<#local endPage = currentPage + 4>
	<#if (endPage > totalPage)><#local endPage = totalPage></#if>
	<div  align="center" class="row">
		<span>共#{totalNum}条记录</span>
		<nav>
		  <ul class="pagination">
			<#if (currentPage <= 8)>
				<#local startPage = 1>
			</#if>
			<#if ((totalPage - currentPage) < 8)>
				<#local endPage = totalPage>
			</#if>
			
			<#if (currentPage == 1)>
				<li class="disabled"><a href="#" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
			<#else>
				<li class=""><a href="${actionUrl}#{currentPage - 1}${urlParas!}" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
			</#if>
			<#if (currentPage > 8)>
				<li><a href="${actionUrl}#{1}${urlParas!}">#{1}</a></li>
				<li><a href="${actionUrl}#{2}${urlParas!}">#{2}</a></li>
				<li><span>...</span></li>
			</#if>
			
			<#list startPage..endPage as i>
				<#if currentPage == i>
					 <li class="active"><a href="#">${i}<span class="sr-only">(current)</span></a></li>
				<#else>
					 <li ><a href="${actionUrl}#{i}${urlParas!}">${i}</a></li>
				</#if>
			</#list>
			
			<#if ((totalPage - currentPage) >= 8)>
				<li><a href="#">...</a></li>
				<li><a href="${actionUrl}#{totalPage - 1}${urlParas!}">#{totalPage - 1}</a></li>
				<li><a href="${actionUrl}#{totalPage}${urlParas!}">#{totalPage}</a></li>
			</#if>
			
			<#if (currentPage == totalPage)>
				<li class="disabled"><a href="#" aria-label="下一页"><span aria-hidden="true">&raquo;</span></a></li>
			<#else>
				<li><a href="${actionUrl}#{currentPage + 1}${urlParas!}" rel="next">&raquo;</a></li>
			</#if>
			 </ul>
		</nav>
	</div>
</#macro>